Conventionally, as still image compression schemes, a JPEG scheme using discrete cosine transform and a scheme using Wavelet transform are used in many cases. An encoding scheme of this type is a variable-length encoding scheme, and hence the amount of code changes for each image to be encoded.
According to the JPEG scheme as an international standardization scheme, only one quantization matrix can be defined for an image. If, therefore, this scheme is applied to a system which cannot adjust an amount of code without prescan and stores codes in a limited memory, a memory overflow may occur.
In order to prevent this, conventional schemes used a method of re-reading an original upon changing the compression ratio when the actual amount of code exceeds an expected amount of code, a method of estimating an amount of code in advance by prescan and re-setting quantization parameters to adjust the amount of code, and the like.
As an amount of code control scheme using prescan, for example, a scheme of storing pre-compressed data in an internal buffer memory, decompressing the data, full-compressing it upon changing the compression parameter, and outputting the resultant data to an external memory is available. In this case, the compression ratio in full-compression is higher than that in pre-compression.
Another scheme is known, in which an allowable amount of code for each pixel block is obtained, and the coefficients obtained by level-shifting DCT coefficients n times are Huffman-encoded to reduce the amount of code. This shifting times n is determined from the allowable amount of code.
Conventionally, however, a compression buffer with a capacity larger than a target compression capacity is required as a compression buffer, and a buffer having a capacity large enough to record original image data is inevitably required to prevent an overflow in an intermediate buffer.
In addition, in the method of repeating encoding operation, since decoding and re-compression operations are performed for the overall compressed data, an increase in the speed of continuous processing cannot be expected.
On the other hand, so-called image area information accompanies original image data. The image area information is mainly used to color processing or adjustment of the number of graylevels in an image output unit in order to improve the appearance of an output image. Consider a natural image having both chromatic and achromatic components and black characters that are often seen in an original. The natural image can be made to look more like a natural image and black characters can be sharpened by using different types of black inks.
If attribute flag data, each consisting one bit and identifying a chromatic component, achromatic component, or character portion, is provided for each pixel, the quality of an output image can be improved at the time of image output, and in particular, at the time of printout. The image area information includes information other than the above information.
To compress image information, the above image area information must be compressed as well as image data. The image area information is a set of binary data. This information must be basically compressed by using a lossless encoding scheme. Conventionally, the PackBits and JBIG encoding schemes have been used to compress image area information.
However, amount of code adjustment cannot be done by simply compressing the above image area information using such an encoding scheme. When such a scheme is used in a system designed to store data in a limited memory, memory overflow may occur, posing a serious problem.
Conventionally, however, studies have been centered on the compression of image data, but little studies have been made on the compression of image area information. In addition, almost no consideration has been given to compressing the image area information into an amount of code within a target value, and the image area information has been simply encoded by using a given encoding scheme.